//
//  EJSOrderDetailOrderInfoTableViewCell.m
//  EnjoyShoppingStreet
//
//  Created by lifayu on 2018/1/8.
//  Copyright © 2018年 lifayu. All rights reserved.
//

#import "EJSOrderDetailOrderInfoTableViewCell.h"

@implementation EJSOrderDetailOrderInfoTableViewCell{
    NSString *_orderNo;
    NSString *_payNo;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)configCell:(NSString *)orderNo payMethod:(NSString *)payMethod payNo:(NSString *)payNo orderTime:(NSString *)orderTime;{
    _orderNo = orderNo;
    _payNo = payNo;
    
    NSString *orderNoString = @"订单编号：";
    if(_orderNo){
        orderNoString = [orderNoString stringByAppendingString:_orderNo];
    }
    self.orderNoLabel.text = orderNoString;
    
    NSString *payMethodString = @"支付方式：";
    if(payMethod){
        payMethodString = [payMethodString stringByAppendingString:payMethod];
    }
    self.payMethodLabel.text = payMethodString;
    
    NSString *payNoString = @"支付交易单号：";
    if(payNo){
        payNoString = [payNoString stringByAppendingString:payNo];
    }
    self.payNoLabel.text = payNoString;
    
    NSString *orderTimeString = @"下单时间：";
    if(orderTime){
        orderTimeString = [orderTimeString stringByAppendingString:orderTime];
    }
    self.orderTimeLabel.text = orderTimeString;
}
- (IBAction)copyOrderNoAction:(id)sender {
    if(_orderNo){
        UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard];
        pasteBoard.string = _orderNo;
         [[HUDHelper sharedInstance] tipMessage:@"已复制订单号"];
    }else{
        [[HUDHelper sharedInstance] tipMessage:@"暂无订单号"];
    }
}
- (IBAction)copyPayNoAction:(UIButton *)sender {
    if(_payNo){
        UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard];
        pasteBoard.string = _payNo;
        [[HUDHelper sharedInstance] tipMessage:@"已复制支付交易单号"];
    }else{
        [[HUDHelper sharedInstance] tipMessage:@"暂无支付交易单号"];
    }
}

@end
